<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('添加房间')" />
</head>
<body class="gray-bg">
    <div class="col-md-12">
        <form class="form-horizontal m" id="form-hotel-room-detail-add">
            <input id="hotelId" name="hotelId" type="hidden" th:value="${hotel.id}" value="${hotel.id}">
            <input id="status" name="status" type="hidden" value="0">
            <div class="form-group">
                <label class="col-sm-3 control-label">房间编号：</label>
                <div class="col-sm-9">
                    <input type="text" name="roomNum" class="form-control" placeholder="请输入房间编号" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">房间归属栋：</label>
                <div class="col-sm-9">
                    <input type="text" name="building" class="form-control" placeholder="请输入房间归属栋">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">房间楼层：</label>
                <div class="col-sm-9">
                    <input type="text" name="floor" class="form-control" placeholder="请输入房间楼层">
<!--                    <select class="form-control" name="floor">-->
<!--                        <option value="1">1</option>-->
<!--                        <option value="2">2</option>-->
<!--                        <option value="3">3</option>-->
<!--                        <option value="4">4</option>-->
<!--                        <option value="5">5</option>-->
<!--                    </select>-->
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">房间类型：</label>
                <div class="col-sm-9">
                    <select name="roomType" class="form-control m-b" th:with="type=${@dict.getType('hotel_room_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
<!--                    <select class="form-control" name="roomType">-->
<!--                        <option value="1">标间</option>-->
<!--                    </select>-->
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">归属酒店：</label>
                <div class="col-sm-9">
                    <p class="form-control-static">[[${hotel.name}]] </p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">房间备注：</label>
                <div class="col-sm-9">
                    <textarea type="text" name="remark" class="form-control" placeholder="请输入备注"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "hotel/room/detail";

        $("#form-hotel-room-detail-add").validate({
            onkeyup: false,
            rules:{
                // userPhone:{
                // 	isPhone:true
                // },
                // userEmail:{
                // 	email:true
                // },
            },
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-hotel-room-detail-add').serialize());
            }
        }
    </script>
</body>
</html>